package com.wyl.studyredis.business.service;

import com.wyl.studyredis.business.entity.School;
import com.wyl.studyredis.business.vo.SchoolVo;

public interface ISchoolCacheService {

    /**
     * 根据id在缓存中查询，如果缓存不存在则尝试在数据库中查询，如果查询不为空则将查询结果设置到缓存中
     * 是否要获取对象引用的值，如果isDeep为true可能会导致无限递归
     * @param id 主键
     */
    SchoolVo getSchoolVoByIdInCache(String id, boolean isDeep) throws Exception;

    School saveAndCache(School school);

    School updateByIdAndCache(School school);

    void removeByIdAndCache(String id);
}
